package com.hutao.service.serviceImpl;

import com.hutao.mapper.AddressMapper;
import com.hutao.pojo.Address;
import com.hutao.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author HUTAO
 * @Description
 * @date 2022/3/10 9:00
 */
@Service
public class AddressServiceImpl implements AddressService {
	
	@Autowired
	private AddressMapper addressMapper;
	
	/**
	 * 根据获取customerid获取地址
	 * @param customerid
	 * @return
	 */
	@Override
	public List<Address> getAddress(int customerid) {
		return addressMapper.getAddress(customerid);
	}
	
	/**
	 * 根据addressid查地址
	 * @param addressid
	 * @return
	 */
	@Override
	public Address getAddressByAid(int addressid) {
		return addressMapper.getAddressByAid(addressid);
	}
	
	/**
	 * 修改地址
	 * @param address
	 * @return
	 */
	@Override
	public int updateAddress(Address address) {
		return addressMapper.updateAddress(address);
	}
	
	/**
	 * 删除地址
	 * @param addressid
	 * @return
	 */
	@Override
	public int deleteAddress(int addressid) {
		return addressMapper.deleteAddress(addressid);
	}
	
	/**
	 * 添加地址
	 * @param address
	 * @return
	 */
	@Override
	public int addAddress(Address address) {
		return addressMapper.addAddress(address);
	}
}
